import { Component } from 'react';
import { connect } from 'react-redux';
import { saveLoginUser, saveLoginPerm } from '../../../store/store1/action';

class FChild1 extends Component {
	state = {
		msg1: 'h111',
		msg2: 'h222',
	}
	pFn = () => {
		console.log('FChild1', 'pFn');
		this.props.saveLoginUser('orderSum33', 'orderSum');
	}
	// 渲染函数
    render() {
    	return (
			<div>
			    <div onClick={this.pFn}>FChild1:点击事件:{this.props.loginUser.orderSum}</div>
			</div>
		);
    }
};

export default connect(state => ({
	loginUser: state.loginUser,
	loginPerm: state.loginPerm,
}), {
	saveLoginUser, 
	saveLoginPerm,
})(FChild1);
